package com.chalk.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.chalk.common.util.Result;
import com.chalk.model.Org;
import com.chalk.model.SysUser;
import com.chalk.service.OrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author glq
 * @since 2020-12-21
 */

@RestController
@RequestMapping("/v1/org")
public class OrgController {

    @Autowired
    OrgService orgService;

    /*/**
     * @Author 86130
     * @Description //todo 查询所有机构
     * @methodName getAllOrgs
     * @return Result
     * @Date  2021/9/26 10:48
     **/
    @GetMapping
    public Result getAllOrgs(){
        List<Org> orgList = orgService.selectList(new EntityWrapper<Org>().eq("is_delete", 0));
        return orgList !=null ? Result.success(orgList) : Result.fail();
    }

}

